package newKe;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class HJ20 {
    public static void main(String[] args) {
        int x = 999;
        while (x+1>x) x++;
        System.out.println(x);

        Scanner sc = new Scanner(System.in);
        int len = sc.nextInt();
        String[] arr = new String[len];
        for(int i=0;i<len;i++){
            String s = sc.next();
            arr[i] = s;
        }

        Arrays.sort(arr);
        for (String str : arr) {
            System.out.println(str);
        }
    }
}
